//
//  MainTabView.swift
//  jiweiapp
//
//  Created by Kin Wong on 15/8/13.
//  Copyright (c) 2015年 Kin Wong. All rights reserved.
//

import UIKit

class MainTabView: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        var mainView = MainView()
        var acceptedView = AcceptedView()
        var moreView = MoreView() //消息界面和设置界面实例化
        
        mainView.title = "新消息"
        acceptedView.title = "已接任务"
        moreView.title = "更多" //设置两个界面的Tab名字
        
        mainView.tabBarItem.image = UIImage(named: "MainTabIcon")
        
        var mainBar = UINavigationController(rootViewController: mainView)
        var acceptedBar = UINavigationController(rootViewController: acceptedView)
        var moreBar = UINavigationController(rootViewController: moreView) //创建上部导航栏
        mainBar.navigationBar.barTintColor = UIColor(red: 91/255, green: 217/255, blue: 86/255, alpha: 0)
        acceptedBar.navigationBar.barTintColor = UIColor(red: 91/255, green: 217/255, blue: 86/255, alpha: 0)
        moreBar.navigationBar.barTintColor = UIColor(red: 254/255, green: 185/255, blue: 35/255, alpha: 0) //更改导航栏颜色
        
        self.viewControllers = [mainBar, acceptedBar, moreBar]
        self.selectedIndex = 0 //默认选择界面
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
